{
  "cells": [
    {
      "metadata": {
        "trusted": true
      },
      "cell_type": "code",
      "source": "#引入资产发布SDK\nfrom bexk_da_sdk import bexk_da_repo",
      "execution_count": null,
      "outputs": []
    },
    {
      "metadata": {
        "trusted": true
      },
      "cell_type": "code",
      "source": "#引入EplatDatasource\nfrom bexk_eplat_sdk import EplatDatasource\n#引入数据处理库\nimport pandas as pd\n#获取连接\nds= EplatDatasource()\nconn = ds.get_connection_by_name(ds_name =\"T_bg00mabcdp\")\nquery_sql = \"select * from BG00MABCDP.T_ADS_FACT_EXAM20250528\"\n# 读取数据到 DataFrame\ndf = pd.read_sql_query(query_sql, conn)\n# 连接关闭【必须关闭，不然会影响下一次拿连接】\nconn.close()\n# 写入 CSV 文件\ndf.to_csv('output.csv', index=False, encoding='utf-8')",
      "execution_count": null,
      "outputs": []
    },
    {
      "metadata": {
        "trusted": true
      },
      "cell_type": "code",
      "source": "da_ename = \"ca_housing_0601\"\n# 发布数据集版本，版本号自增\nbexk_da_repo.release(\"DS:PD\",  # 资产子类型\n                     da_ename,  # 资产英文名\n                     \"./output.csv\",  # 源文件\n                     da_trace_deploy_dict=None) # 版本发布回流信息",
      "execution_count": null,
      "outputs": []
    },
    {
      "metadata": {
        "trusted": true
      },
      "cell_type": "code",
      "source": "",
      "execution_count": null,
      "outputs": []
    },
    {
      "metadata": {
        "trusted": true
      },
      "cell_type": "code",
      "source": "",
      "execution_count": null,
      "outputs": []
    },
    {
      "metadata": {
        "trusted": true
      },
      "cell_type": "code",
      "source": "",
      "execution_count": null,
      "outputs": []
    },
    {
      "metadata": {
        "trusted": true
      },
      "cell_type": "code",
      "source": "",
      "execution_count": null,
      "outputs": []
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "version": "3.8.8",
      "mimetype": "text/x-python",
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "pygments_lexer": "ipython3",
      "nbconvert_exporter": "python",
      "file_extension": ".py"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}